package com.edu.service.impl;

import com.edu.bean.User;
import com.edu.mapper.UserMapper;
import com.edu.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;
@Component
public class UserServiceImpl implements UserService {
    @Resource
    UserMapper userMapper;
    @Override
    public List<User> selectAllUser() {
        List<User> users = userMapper.selectAllUser();

        return users;
    }

    @Override
    public User selectUserById(int userId) {
        User user = userMapper.selectUserById(userId);
        return user;
    }

    @Override
    public int insertUser(User user) {
        int i = userMapper.insertUser(user);
        return i;
    }

    @Override
    public int deleteUserById(int userId) {
        int i = userMapper.deleteUserById(userId);
        return i;
    }
}
